
<?php echo $output;

 ?>
 <script src="<?php echo base_url(); ?>public/js/autoNumeric.js"></script>
 <script>
 var qty = {aSep: '',aDec: ',',vMin: '0.000',vMax: '99999.999'};
 
$('#room_number').val($('#room-number').text());
$('.qty').autoNumeric('init',qty);
$(document).ready(function() {
	$('#field-material_id').on('change', function(evt, params) {
		$.ajax().abort();
		$.ajax({
			type: "POST",
			dataType: 'json',
			url: "<?php echo site_url("room/max_material_qty");?>",
			data: {'material_id': $('#field-material_id').val()},
			success: function(data){
				$('[name="room_mat_qty"]').attr('title', 'Max Qty: '+data);
				$('.qty').autoNumeric('destroy');
				$('.qty').autoNumeric('init', {aSep: '',aDec: ',',vMin: '0.000',vMax: data});
				$('.qty').autoNumeric('set', '0');
			}
		});
	 });
});

</script>

<a class="btn" href="<?= base_url('room') ?>" >Back to Room List</a>
<br><br>